package jjn.acwing.java_basic;

import java.util.Scanner;

/**
 * @author Jiang Jining
 * @since 2023-09-14 0:20
 */
public class Acwing87 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String line = scanner.nextLine().trim();
        long res = 0;
        int sign = 1;
        if (line.startsWith("-")) {
            sign = -1;
        }
        if (line.startsWith("+") || line.startsWith("-")) {
            line = line.substring(1);
        }
        for (int i = 0; i < line.length(); i++) {
            char c = line.charAt(i);
            if (c < '0' || c > '9') {
                break;
            }
            res = res * 10 + c - '0';
            if (res > 1e11) {
                break;
            }
        }
        res = res * sign;
        if (res > Integer.MAX_VALUE) {
            res = Integer.MAX_VALUE;
        }
        if (res < Integer.MIN_VALUE) {
            res = Integer.MIN_VALUE;
        }
        System.out.println(res);
    }
}
